package com.example.proyyj.Service;

import com.example.proyyj.Entity.Building;
import com.example.proyyj.Entity.CollectionBuilding;
import com.example.proyyj.Impl.CollectionBuildingImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CollectionBuildingService implements CollectionBuildingImpl {

    @Resource//依赖注入
    CollectionBuildingImpl collectionBuilding;

    /**
     * 是否收藏
     * @param UserId
     * @param BuildingId
     * @return
     */
    @Override
    public CollectionBuilding collectionBuilding(int UserId, int BuildingId) {
        return collectionBuilding.collectionBuilding(UserId,BuildingId);
    }

    /**
     * 添加收藏建筑
     * @param UserId
     * @param BuildingId
     * @return
     */
    @Override
    public int addBuilding(int UserId, int BuildingId) {
        return collectionBuilding.addBuilding(UserId,BuildingId);
    }

    /**
     * 取消收藏
     * @param UserId
     * @param BuildingId
     * @return
     */
    @Override
    public int delBuilding(int UserId, int BuildingId) {
        return collectionBuilding.delBuilding(UserId, BuildingId);
    }

    /**
     * 查看用户收藏
     * @param UserId
     * @return
     */
    @Override
    public List<CollectionBuilding> lookBuildinglist(int UserId) {
        return collectionBuilding.lookBuildinglist(UserId);
    }




    /**
     * 查看用户的收藏 根据id查询 详情查看收藏的东西
     * @param BuildingId
     * @return
     */
    @Override
    public Building lookBuilding(int BuildingId) {
        return collectionBuilding.lookBuilding(BuildingId);
    }
}
